<?xml version="1.0"?>

<!-- created from master.xsd using rngconv, available at 
     http://wwws.sun.com/software/xml/developers/relaxngconverter. 
     Then, xsi:noNamespaceSchemaLocation attribute and namespace
	  and snee stage elements added by hand. -->

<grammar ns="" xmlns="http://relaxng.org/ns/structure/0.9"
			datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
			xmlns:sn="http://www.snee.com/ns/stages"
			xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>
    <start>

        <sn:stages>
          <sn:stage name="public"/>
          <sn:stage name="post-floob"/>
          <sn:stage name="post-zatz"/>
          <sn:stage name="final"/>
        </sn:stages>

        <choice>
            <ref name="a" sn:stages="public post-floob"/>
            <ref name="company"/>
            <ref name="person"/>
            <ref name="par"/>
            <ref name="link"/>
            <ref name="product"/>
            <choice>
                <notAllowed/>
                <element name="article">
                    <group>
                        <attribute name="xsi:noNamespaceSchemaLocation">
                            <data type="string"/>
                        </attribute>
                        <attribute name="aid" sn:stages="post-floob post-zatz final">
                            <data type="string"/>
                        </attribute>
                        <attribute name="checkIn" sn:stages="post-floob post-zatz final">
                            <data type="dateTime"/>
                        </attribute>
                        <attribute name="dateline" sn:stages="post-zatz final">
                            <data type="string"/>
                        </attribute>
                        <ref name="title"/>
                    </group>
                    <oneOrMore>
                        <ref name="par"/>
                    </oneOrMore>
                </element>
            </choice>
            <ref name="title"/>
        </choice>
    </start>
    <define name="par">
        <choice>
            <notAllowed/>
            <element name="par">
                <mixed>
                    <zeroOrMore>
                        <choice>
                            <ref name="company" sn:stages="post-zatz final"/>
                            <ref name="product" sn:stages="post-zatz final"/>
                            <ref name="link" sn:stages="post-zatz final"/>
                            <ref name="a" sn:stages="public post-floob"/>
                            <ref name="person"/>
                        </choice>
                    </zeroOrMore>
                </mixed>
            </element>
        </choice>
    </define>
    <define name="link">
        <choice>
            <notAllowed/>
            <element name="link">
                <data type="string"/>
                <attribute name="uri">
                    <data type="anyURI"/>
                </attribute>
            </element>
        </choice>
    </define>
    <define name="product">
        <choice>
            <notAllowed/>
            <element name="product">
                <data type="string"/>
            </element>
        </choice>
    </define>
    <define name="title">
        <choice>
            <notAllowed/>
            <element name="title">
                <data type="string"/>
            </element>
        </choice>
    </define>
    <define name="a" sn:stages="public post-floob">
        <choice>
            <notAllowed/>
            <element name="a">
                <data type="string"/>
                <attribute name="href">
                    <data type="anyURI"/>
                </attribute>
            </element>
        </choice>
    </define>
    <define name="company">
        <choice>
            <notAllowed/>
            <element name="company">
                <data type="string"/>
                <attribute name="id" sn:stages="final">
                    <key ns="" name="XML_ID">
                        <data type="NCName"/>
                    </key>
                </attribute>
            </element>
        </choice>
    </define>
    <define name="person">
        <choice>
            <notAllowed/>
            <element name="person">
                <data type="string"/>
            </element>
        </choice>
    </define>
</grammar>
